package com.msmall.community.common.action.html;

import com.msmall.base.action.HTMLBaseAction;
import com.msmall.base.util.ConstantAjax;
import com.msmall.community.common.model.Message;
import com.msmall.community.common.service.MessageManager;

public class MessageAction extends HTMLBaseAction{

	private static final long serialVersionUID = 237176189403936875L;

	private Long messageid;
	
	private MessageManager messageManager;
	
	public String remove(){
		StringBuffer buffer = new StringBuffer();
		buffer.append(ConstantAjax.RETURN_PRE);
		try{
			messageManager.remove(Message.class, messageid);
			buffer.append(createResult("true"));
		}catch(Exception e){
			buffer.append(createResult("false"));
		}
		buffer.append(ConstantAjax.RETURN_SUFF);
		message = buffer.toString();
		return SUCCESS;
	}

	public Long getMessageid() {
		return messageid;
	}

	public void setMessageid(Long messageid) {
		this.messageid = messageid;
	}

	public void setMessageManager(MessageManager messageManager) {
		this.messageManager = messageManager;
	}
}
